#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{    
    ui->setupUi(this);

       QObject::connect(ui->bouton0,SIGNAL(clicked()),this,SLOT(zero()));
       QObject::connect(ui->bouton1,SIGNAL(clicked()),this,SLOT(un()));
       QObject::connect(ui->bouton2,SIGNAL(clicked()),this,SLOT(deux()));
       QObject::connect(ui->bouton3,SIGNAL(clicked()),this,SLOT(trois()));
       QObject::connect(ui->bouton4,SIGNAL(clicked()),this,SLOT(quatre()));
       QObject::connect(ui->bouton5,SIGNAL(clicked()),this,SLOT(cinq()));
       QObject::connect(ui->bouton6,SIGNAL(clicked()),this,SLOT(six()));
       QObject::connect(ui->bouton7,SIGNAL(clicked()),this,SLOT(sept()));
       QObject::connect(ui->bouton8,SIGNAL(clicked()),this,SLOT(huit()));
       QObject::connect(ui->bouton9,SIGNAL(clicked()),this,SLOT(neuf()));
       QObject::connect(ui->plus,SIGNAL(clicked()),this,SLOT(plus()));
       QObject::connect(ui->moins,SIGNAL(clicked()),this,SLOT(moins()));
       QObject::connect(ui->multiplie,SIGNAL(clicked()),this,SLOT(multiplie()));
       QObject::connect(ui->divise,SIGNAL(clicked()),this,SLOT(divise()));
       QObject::connect(ui->espace,SIGNAL(clicked()),this,SLOT(espace()));
       QObject::connect(ui->point,SIGNAL(clicked()),this,SLOT(point()));

}


MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow:: zero(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(0)));}
void MainWindow:: un(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(1)));}
void MainWindow:: deux(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(2)));}
void MainWindow:: trois(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(3)));}
void MainWindow:: quatre(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(4)));}
void MainWindow:: cinq(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(5)));}
void MainWindow:: six(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(6)));}
void MainWindow:: sept(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(7)));}
void MainWindow:: huit(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(8)));}
void MainWindow:: neuf(){ui->Inputline->setText(ui->Inputline->text().append(QString::number(9)));}
void MainWindow:: plus(){ui->Inputline->setText(ui->Inputline->text().append("+"));}
void MainWindow:: moins(){ui->Inputline->setText(ui->Inputline->text().append("-"));}
void MainWindow:: multiplie(){ui->Inputline->setText(ui->Inputline->text().append("*"));}
void MainWindow:: divise(){ui->Inputline->setText(ui->Inputline->text().append("/"));}
void MainWindow:: espace(){ui->Inputline->setText(ui->Inputline->text().append(" "));}
void MainWindow:: point(){ui->Inputline->setText(ui->Inputline->text().append("."));}

